
#include <iostream>

#include <cppunit/extensions/HelperMacros.h>

#include "../../tuxitty/src/MsnSession.h"

class MsnSessionTest : public CppUnit::TestFixture
{
	CPPUNIT_TEST_SUITE( MsnSessionTest );

	CPPUNIT_TEST( TestAddContact );	
	CPPUNIT_TEST( TestRemoveContact );	
	CPPUNIT_TEST( TestIsForContact );	

	CPPUNIT_TEST_SUITE_END();

public:
	MsnSession* session;

	void setUp(){
		session = new MsnSession(NULL);
	}

	void tearDown(){
		delete session;
	}


	void TestAddContact()
	{	
		session->AddContact(_T("test"));
		CPPUNIT_ASSERT(1 == session->GetContactList().size());

		session->AddContact(_T("test"));
		CPPUNIT_ASSERT(1 == session->GetContactList().size());
	}

	void TestRemoveContact()
	{	
		session->AddContact(_T("test"));
		session->AddContact(_T("test2"));

		session->RemoveContact(_T("test"));
		CPPUNIT_ASSERT(1 == session->GetContactList().size());
	}

	void TestIsForContact()
	{	
		session->AddContact(_T("test"));
		CPPUNIT_ASSERT(session->IsForContact(_T("test")));

		session->AddContact(_T("test2"));
		CPPUNIT_ASSERT(!session->IsForContact(_T("test")));

	}



};


CPPUNIT_TEST_SUITE_REGISTRATION(MsnSessionTest);
